<?php

require_once 'quickstart-loading-re.php';

$coin1 = re::relation(array(
    array('COIN_1'=>'HEADS')
   ,array('COIN_1'=>'TAILS')
));

$coin2 = re::relation(array(
    array('COIN_2'=>'HEADS')
   ,array('COIN_2'=>'TAILS')
));

$possibleOutcomes = $coin1->times($coin2);

$listOfPossibleOutcomes = $possibleOutcomes->toArray();

echo "<table>";
echo "<tr><td>Coin #1</td><td>Coin #2</td></tr>";
foreach($listOfPossibleOutcomes as $tuple){
    echo "<tr>";
	echo sprintf("<td>%s</td><td>%s</td>",$tuple->get('COIN_1'), $tuple->get('COIN_2'));
	echo "</tr>";
}
echo "</table>";
